package com.flying.invest.strategy.service;

import java.util.Date;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.common.util.Codes;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.service.AbstractService;
import com.flying.framework.model.ActionResult;
import com.flying.framework.model.QueryResult;

import com.flying.invest.strategy.model.StrategyTrendDetail;

@Service(value="StrategyTrendDetailService", desc="趋势策略明细")
public class StrategyTrendDetailService extends AbstractService{
        
	@MethodInfo("新增")
	@DaoCreate(entity=StrategyTrendDetail.ENTITY_NAME)
	public StrategyTrendDetail create(
			@Param(value=StrategyTrendDetail.USER_ID, required=true,	desc="所属用户") Long user_id,
			@Param(value=StrategyTrendDetail.TYPE_ID, required=true,	desc="策略类型") Long type_id,
			@Param(value=StrategyTrendDetail.INVEST_ID, required=true,	desc="投资项目") Long invest_id,
			@Param(value=StrategyTrendDetail.STRATEGY_ID, required=true,	desc="策略ID") Long strategy_id,
			
			@Param(value=StrategyTrendDetail.NUM, required=true,	desc="期数") Integer num,
			@Param(value=StrategyTrendDetail.PRICE_INTERVAL, required=true,	desc="档位") Double price_interval,
			@Param(value=StrategyTrendDetail.SUGGEST_BUY_PRICE, required=true,	desc="建议买入价格") Double suggest_buy_price,
			@Param(value=StrategyTrendDetail.SUGGEST_BUY_AMOUNT, required=false,	desc="建议买入金额") Double suggest_buy_amount,
			@Param(value=StrategyTrendDetail.SUGGEST_BUY_QUANTITY, required=false,	desc="建议买入数量") Double suggest_buy_quantity) {
		
		return null;
	}

	@MethodInfo("修改")
	@DaoUpdate(entity=StrategyTrendDetail.ENTITY_NAME)
	public ActionResult updateBuyInfo(
			@Param(value=StrategyTrendDetail.DETAIL_ID, required=true,	desc="ID") Long detail_id,
			
			@Param(value=StrategyTrendDetail.BUY_PRICE, required=true,	desc="实际买入价格") Double buy_price,
			@Param(value=StrategyTrendDetail.BUY_QUANTITY, required=true,	desc="实际买入数量") Double buy_quantity,
			@Param(value=StrategyTrendDetail.BUY_AMOUNT, required=true,	desc="实际买入金额") Double buy_amount,
			@Param(value=StrategyTrendDetail.TRANSACTION_ID, required=true,	desc="交易ID") Long transaction_id,
			@Param(value=StrategyTrendDetail.TRANSACTION_DATE, required=true,	desc="网格数量") Date transaction_date,
			
			@Param(value=StrategyTrendDetail.SUGGEST_SELL_PRICE, required=true,	desc="建议卖出价格") Double suggest_sell_price,
			@Param(value=StrategyTrendDetail.PRICE, required=false,	desc="市价") Double price,
			@Param(value=StrategyTrendDetail.PROFIT, required=false,	desc="利润") Double profit
			
		) {
		
		return null;
	}

	@MethodInfo("修改")
	@DaoUpdate(entity=StrategyTrendDetail.ENTITY_NAME)
	public ActionResult updateSellInfo(
			@Param(value=StrategyTrendDetail.DETAIL_ID, required=true,	desc="ID") Long detail_id,

			@Param(value=StrategyTrendDetail.SELL_PRICE, required=true,	desc="实际卖出价格") Double sell_price,
			@Param(value=StrategyTrendDetail.SELL_QUANTITY, required=true,	desc="实际卖出数量") Double sell_quantity,
			@Param(value=StrategyTrendDetail.SELL_AMOUNT, required=true,	desc="实际卖出金额") Double sell_amount,
			
			@Param(value=StrategyTrendDetail.PRICE, required=true,	desc="市价") Double price,
			@Param(value=StrategyTrendDetail.PROFIT, required=true,	desc="利润") Double profit
		) {
		
		return null;
	}

	@MethodInfo("修改")
	@DaoUpdate(entity=StrategyTrendDetail.ENTITY_NAME)
	public ActionResult updateProfitInfo(
			@Param(value=StrategyTrendDetail.DETAIL_ID, required=true,	desc="ID") Long detail_id,
			
			@Param(value=StrategyTrendDetail.PRICE, required=true,	desc="市价") Double price,
			@Param(value=StrategyTrendDetail.PROFIT, required=true,	desc="利润") Double profit
		) {
		
		return null;
	}
	
	@MethodInfo("删除")
	@DaoRemove(entity=StrategyTrendDetail.ENTITY_NAME)
	public ActionResult removeByStrategyId(
			@Param(value=StrategyTrendDetail.STRATEGY_ID, required=true,	desc="策略ID") Long strategy_id
		) {
		return null;
	}

	@MethodInfo("搜索")
	@DaoQuery(entity=StrategyTrendDetail.ENTITY_NAME, pageable=true, modelClass=StrategyTrendDetail.class, osql="order by num")
	public QueryResult<StrategyTrendDetail> findAll(
			@Param(value=StrategyTrendDetail.STRATEGY_ID, required=false,	desc="策略ID") Long strategy_id,
			@Param(value=Codes.PAGE_NUM, 	required=false, desc="分页页号，默认0") int page,
			@Param(value=Codes.PAGE_SIZE, 	required=false, desc="分页大小，默认10") int rows) {
		return null;
	}

	@MethodInfo("搜索")
	@DaoQuery(entity=StrategyTrendDetail.ENTITY_NAME, pageable=false, modelClass=StrategyTrendDetail.class, osql="order by num desc")
	public QueryResult<StrategyTrendDetail> findByStrategyId(
			@Param(value=StrategyTrendDetail.STRATEGY_ID, required=true,	desc="策略ID") Long strategy_id) {
		return null;
	}

	@MethodInfo("查询")
	@DaoQuery(entity=StrategyTrendDetail.ENTITY_NAME, single=true, throwsNotFoundException=true )
	public StrategyTrendDetail findById(
			@Param(value=StrategyTrendDetail.DETAIL_ID, required=true,	desc="ID") Long detail_id
		) {
		return null;
	}

}